#pragma once
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <map>

#include <boost/algorithm/string.hpp>

using namespace std;

struct StuInfo                              
{    
    StuInfo()     
    {    
        StuName = "";    
        OutOfClassCount = "";    
    }    
    string StuName;             
    string OutOfClassCount;    
};

class FileOperSer
{
public:
    FileOperSer();

    int OnInit(const string& FileName);
    int EraseFromMap(int index);
    int FindFromMap(int index, StuInfo* si);
    int WriteToFile();
    int GetMapSize();
    int UpdateMapData(const int index, bool IsExist);

    void ShowAllDataFromMap();
private:
    int SetFileName(const string& FileName);
    int ReadFromFile();
    //切割字符串
   void SpiltLine(string& Line, const string& SplitChar, vector<string>* OutValueVec);
private:
    string FileName_;
    map<int, StuInfo> StuInfoMap_;
};


class GetErrorFileAndNum
{
public:
    static void Printf()
    {
        printf("this call is error %s:%d\n", __FILE__, __LINE__);
    }
};
